package models

import "time"

/**
 * @Author SSWANG
 * @Description //TODO Community结构体
 * @Date 10:56 2022/10/28
 **/
type Community struct {
	CommunityID   uint64 `gorm:"type:int(10);column:community_id;not null" json:"community_id"`
	CommunityName string `gorm:"type:varchar(128);column:community_name;not null" json:"community_name"`
}

// GORM: TableName 会将 Community 的表名重写为 `community`
func (Community) TableName() string {
	return "community"
}

/**
 * @Author SSWANG
 * @Description //TODO 社区详情model
 * @Date 10:58 2022/10/28
 **/
type CommunityDetail struct {
	CommunityID   uint64    `gorm:"type:int(10);column:community_id;not null" json:"community_id"`
	CommunityName string    `gorm:"type:varchar(128);column:community_name;not null" json:"community_name"`
	Introduction  string    `gorm:"type:varchar(256);column:introduction;not null" json:"introduction,omitempty"` // omitempty 当Introduction为空时不展示
	CreateTime    time.Time `gorm:"type:timestamp;column:create_time;not null" json:"create_time"`
}
